<?php /* @var $this Controller */ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>视频广告页</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="X-UA-Compatible" content="IE=7">
    <!-- iphone safari -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/>
    <meta name="apple-mobile-web-app-capable" content="yes" /> 
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />       
    <meta content="telephone=no" name="format-detection" /> 

 <?php 
    Yii::app()->clientScript->registerCssFile(Yii::app()->baseUrl . '/css/screen-min.css' , "screen" );
    ?>
   
</head>

<body> 
<div style="font-size: 16px;line-height: 20px;border-bottom: 1px dotted;text-align: center;padding: 20px 0;margin-bottom: 18px;">请先观看视频，再开始免费上网。剩余<span id="showm">0</span>秒。<br/><a href="<?php echo Yii::app()->createUrl('api/login_form');?>">跳过广告</a></div>
<div id='movie' style='max-width:100%;max-height:100%;margin:0 auto' class='swipe'>
   <video id="frame_play_vp" preload="auto" x-webkit-airplay="allow" style="width: 100%;" autoplay="autoplay"
   onended="goNext();"  onpause="showpause();" onplaying="viewtime();">
        <source src="<?php echo Yii::app()->baseUrl . $model->picture;?>" type="video/mp4" />
        您的浏览器不支持!
   </video>
</div> 

<script type="text/javascript">
    var t;
    var c = 0;
    var myVideo=document.getElementById("frame_play_vp"); 
    function goNext(){
       location.href="<?php echo Yii::app()->createUrl('api/login_form');?>"; 
    }

    function showpause(){ 
        c = document.getElementById('showm').innerHTML;
        clearTimeout(t); 
    }

    function viewtime(){    
     
        var showtime=Math.round(myVideo.duration);  
        if(c == 0 ){
             c=parseInt(showtime);
         }
        document.getElementById('showm').innerHTML= c; 
        c = c - 1;
        t=setTimeout("viewtime()",1000);
       
    } 
    
</script>

</body>
</html>




